package org.szy.admin.controller;

import org.noear.solon.annotation.*;
import org.szy.admin.service.UserService;
import org.szy.core.common.controller.BaseController;
import org.szy.core.common.entity.R;

/**
 * 登录用户控制层
 *
 * @author 孙志阳
 * @date 2023-02-16
 * @since 1.0.0
 **/
@Controller
@Mapping("/user")
public class UserController extends BaseController {

    @Inject
    private UserService userService;

    /**
     * 获取用户菜单
     */
    @Get
    @Mapping("/menu")
    public R<?> menu() {
        return R.data(userService.menu());
    }

    /**
     * 验证密码
     */
    @Post
    @Mapping("/verifyPwd")
    public R<?> verifyPwd(String password) {
        boolean flag = userService.verifyPwd(password);
        return R.bool(flag);
    }

}
